package com.fansl.allround.study.Interview;

/**
 * @author fansl
 * @Description: TODO
 * @date 2019/10/15 11:27
 */
public class EqualsTests {
    public static void main(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        String s3 = "hello";
        String s4 = "hello";
        String s5 = s3;
         //false
        System.out.println(s1==s2);
        //true
        System.out.println(s1.equals(s2));
        //false
        System.out.println(s1==s3);
        //true
        System.out.println(s1.equals(s3));
        //true
        System.out.println(s4==s3);
        //true
        System.out.println(s4.equals(s3));
        //true
        System.out.println(s5==s4);
    }
}
